﻿<Window x:Class="Fidely.Demo.GettingStarted.WPF.Views.DiagnosticsWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Log Viewer"
        MinHeight="600" Height="600" MinWidth="800" Width="800">
    <DockPanel>
        <StackPanel DockPanel.Dock="Top" HorizontalAlignment="Right" >
            <Button Command="{Binding ClearCommand}" Margin="5" Width="60">Clear</Button>
        </StackPanel>
        <DataGrid ItemsSource="{Binding Logs}" AlternatingRowBackground="#F0F0F0" IsReadOnly="True" AutoGenerateColumns="False" HorizontalGridLinesBrush="LightGray" VerticalGridLinesBrush="LightGray">
            <DataGrid.Resources>
                <Style x:Key="ElementStyle" TargetType="TextBlock">
                    <Setter Property="Margin" Value="3"/>
                    <Setter Property="TextWrapping" Value="Wrap"/>
                    <Setter Property="VerticalAlignment" Value="Center"/>
                </Style>
            </DataGrid.Resources>
            <DataGrid.Columns>
                <DataGridTextColumn Header="Category" Binding="{Binding Category}" Width="75" ElementStyle="{StaticResource ElementStyle}"/>
                <DataGridTextColumn Header="Timestamp" Binding="{Binding Timestamp, StringFormat={}{0:yyyy/MM/dd HH:mm:ss.fff zzz}}" Width="180" ElementStyle="{StaticResource ElementStyle}"/>
                <DataGridTextColumn Header="Type" Binding="{Binding Type}" Width="150" ElementStyle="{StaticResource ElementStyle}"/>
                <DataGridTextColumn Header="Message" Binding="{Binding Message}" Width="350" ElementStyle="{StaticResource ElementStyle}"/>
            </DataGrid.Columns>
        </DataGrid>
    </DockPanel>
</Window>
